<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>插槽</title>
  </head>

  <body>
    <script>
      // new Promise((resolve,reject)=>{
      //   setTimeout(()=>{
      //     resolve()
      //   },1000)
      // }).then(()=>{
      //   console.log('hello nmzl')
      //   console.log('hello nmzl')
      //   console.log('hello nmzl')
      //   return new Promise((resolve,reject)=>{
      //     setTimeout(()=>{
      //     resolve()
      //   },1000)
      //   }).then(()=>{
      //     console.log('hello ndaye')
      //     console.log('hello ndaye')
      //     console.log('hello ndaye')
      //   })
      // })

      // new Promise((resolve, reject) => {
      //   setTimeout(() => {
      //     //var data = "success";
      //     //resolve(data);
      //     var err = 'err'
      //     reject(err)
      //   }, 1000);
      // }).then(
      //   data => {
      //     console.log(data);
      //   },
      //   err => {
      //     console.log(err);
      //   }
      // );
      const promise3 = new Promise((resolve, reject) => {
        setTimeout(resolve, 1000, 'a');
      });

      const promise1 = new Promise((resolve, reject) => {
        setTimeout(resolve, 100, 'b');
      });

      const promise2 = new Promise((resolve, reject) => {
        setTimeout(resolve, 2000, 'c');
      });

      const promise5 = new Promise((resolve, reject) => {
        setTimeout(reject, 2000, 'sss');
      });

      Promise.all([promise1,promise2,promise3,promise5]).then(values=>{
        console.log(values)
      }, reason => {
      console.log(reason)
      })

    </script>
  </body>
</html>
